package com.kc.gb.feign.ptl.support.dtos;

import com.kc.gb.feign.ptl.support.enums.PtlLedOnOff;
import com.kc.gb.feign.ptl.support.enums.PtlCommandType;
import com.kc.gb.feign.ptl.support.enums.PtlLightOnOff;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class LedCommand extends AbstractPtlCommand{
    PtlLedOnOff ledStatus;
    int num;

    public LedCommand(int lightNo) {
        this.lightNo = lightNo;
        this.ledStatus = PtlLedOnOff.LED_OFF;
        this.num = 0;
    }

    public LedCommand(int lightNo, PtlLedOnOff ledStatus, int num) {
        this.lightNo = lightNo;
        this.ledStatus = ledStatus;
        this.num = num;
    }

    public LedCommand turnOn(){
        this.ledStatus = PtlLedOnOff.LED_ON;
        return this;
    }

    public LedCommand turnOff(){
        this.ledStatus = PtlLedOnOff.LED_OFF;
        return this;
    }

    public LedCommand flash(){
        this.ledStatus = PtlLedOnOff.LED_FLASH;
        return this;
    }

    public LedCommand num(int num){
        this.num = num;
        return this;
    }

    @Override
    public PtlCommandType getCommandType() {
        return PtlCommandType.LED;
    }
}
